.class public Lweibo4android/RetweetDetails;
.super Lweibo4android/WeiboResponse;
.source "RetweetDetails.java"

# interfaces
.implements Ljava/io/Serializable;


# static fields
.field static final serialVersionUID:J = 0x1b2c267fe22c03d6L


# instance fields
.field private retweetId:J

.field private retweetedAt:Ljava/util/Date;

.field private retweetingUser:Lweibo4android/User;


# direct methods
.method constructor <init>(Lweibo4android/http/Response;Lorg/w3c/dom/Element;Lweibo4android/Weibo;)V
    .locals 0
    .parameter "res"
    .parameter "elem"
    .parameter "weibo"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lweibo4android/WeiboException;
        }
    .end annotation

    .prologue
    .line 81
    invoke-direct {p0, p1}, Lweibo4android/WeiboResponse;-><init>(Lweibo4android/http/Response;)V

    .line 82
    invoke-direct {p0, p1, p2, p3}, Lweibo4android/RetweetDetails;->init(Lweibo4android/http/Response;Lorg/w3c/dom/Element;Lweibo4android/Weibo;)V

    .line 83
    return-void
.end method

.method constructor <init>(Lweibo4android/http/Response;Lweibo4android/Weibo;)V
    .locals 2
    .parameter "res"
    .parameter "weibo"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lweibo4android/WeiboException;
        }
    .end annotation

    .prologue
    .line 56
    invoke-direct {p0, p1}, Lweibo4android/WeiboResponse;-><init>(Lweibo4android/http/Response;)V

    .line 57
    invoke-virtual {p1}, Lweibo4android/http/Response;->asDocument()Lorg/w3c/dom/Document;

    move-result-object v1

    invoke-interface {v1}, Lorg/w3c/dom/Document;->getDocumentElement()Lorg/w3c/dom/Element;

    move-result-object v0

    .line 58
    .local v0, elem:Lorg/w3c/dom/Element;
    invoke-direct {p0, p1, v0, p2}, Lweibo4android/RetweetDetails;->init(Lweibo4android/http/Response;Lorg/w3c/dom/Element;Lweibo4android/Weibo;)V

    .line 59
    return-void
.end method

.method constructor <init>(Lweibo4android/org/json/JSONObject;)V
    .locals 0
    .parameter "json"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lweibo4android/WeiboException;
        }
    .end annotation

    .prologue
    .line 62
    invoke-direct {p0}, Lweibo4android/WeiboResponse;-><init>()V

    .line 63
    invoke-direct {p0, p1}, Lweibo4android/RetweetDetails;->init(Lweibo4android/org/json/JSONObject;)V

    .line 64
    return-void
.end method

.method static createRetweetDetails(Lweibo4android/http/Response;)Ljava/util/List;
    .locals 8
    .parameter "res"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lweibo4android/http/Response;",
            ")",
            "Ljava/util/List",
            "<",
            "Lweibo4android/RetweetDetails;",
            ">;"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lweibo4android/WeiboException;
        }
    .end annotation

    .prologue
    .line 109
    :try_start_0
    invoke-virtual {p0}, Lweibo4android/http/Response;->asJSONArray()Lweibo4android/org/json/JSONArray;

    move-result-object v2

    .line 110
    .local v2, list:Lweibo4android/org/json/JSONArray;
    invoke-virtual {v2}, Lweibo4android/org/json/JSONArray;->length()I

    move-result v4

    .line 111
    .local v4, size:I
    new-instance v3, Ljava/util/ArrayList;

    invoke-direct {v3, v4}, Ljava/util/ArrayList;-><init>(I)V

    .line 112
    .local v3, retweets:Ljava/util/List;,"Ljava/util/List<Lweibo4android/RetweetDetails;>;"
    const/4 v0, 0x0

    .local v0, i:I
    :goto_0
    if-lt v0, v4, :cond_0

    .line 115
    return-object v3

    .line 113
    :cond_0
    new-instance v6, Lweibo4android/RetweetDetails;

    invoke-virtual {v2, v0}, Lweibo4android/org/json/JSONArray;->getJSONObject(I)Lweibo4android/org/json/JSONObject;

    move-result-object v7

    invoke-direct {v6, v7}, Lweibo4android/RetweetDetails;-><init>(Lweibo4android/org/json/JSONObject;)V

    invoke-interface {v3, v6}, Ljava/util/List;->add(Ljava/lang/Object;)Z
    :try_end_0
    .catch Lweibo4android/org/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Lweibo4android/WeiboException; {:try_start_0 .. :try_end_0} :catch_1

    .line 112
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 116
    .end local v0           #i:I
    .end local v2           #list:Lweibo4android/org/json/JSONArray;
    .end local v3           #retweets:Ljava/util/List;,"Ljava/util/List<Lweibo4android/RetweetDetails;>;"
    .end local v4           #size:I
    :catch_0
    move-exception v1

    .line 117
    .local v1, jsone:Lweibo4android/org/json/JSONException;
    new-instance v6, Lweibo4android/WeiboException;

    invoke-direct {v6, v1}, Lweibo4android/WeiboException;-><init>(Ljava/lang/Exception;)V

    throw v6

    .line 118
    .end local v1           #jsone:Lweibo4android/org/json/JSONException;
    :catch_1
    move-exception v5

    .line 119
    .local v5, te:Lweibo4android/WeiboException;
    throw v5
.end method

.method static createRetweetDetails(Lweibo4android/http/Response;Lweibo4android/Weibo;)Ljava/util/List;
    .locals 10
    .parameter "res"
    .parameter "weibo"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lweibo4android/http/Response;",
            "Lweibo4android/Weibo;",
            ")",
            "Ljava/util/List",
            "<",
            "Lweibo4android/RetweetDetails;",
            ">;"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lweibo4android/WeiboException;
        }
    .end annotation

    .prologue
    const/4 v9, 0x0

    .line 126
    invoke-virtual {p0}, Lweibo4android/http/Response;->asDocument()Lorg/w3c/dom/Document;

    move-result-object v0

    .line 127
    .local v0, doc:Lorg/w3c/dom/Document;
    invoke-static {v0}, Lweibo4android/RetweetDetails;->isRootNodeNilClasses(Lorg/w3c/dom/Document;)Z

    move-result v7

    if-eqz v7, :cond_1

    .line 128
    new-instance v5, Ljava/util/ArrayList;

    invoke-direct {v5, v9}, Ljava/util/ArrayList;-><init>(I)V

    .line 143
    :cond_0
    :goto_0
    return-object v5

    .line 131
    :cond_1
    :try_start_0
    const-string v7, "retweets"

    invoke-static {v7, v0}, Lweibo4android/RetweetDetails;->ensureRootNodeNameIs(Ljava/lang/String;Lorg/w3c/dom/Document;)V

    .line 132
    invoke-interface {v0}, Lorg/w3c/dom/Document;->getDocumentElement()Lorg/w3c/dom/Element;

    move-result-object v7

    .line 133
    const-string v8, "retweet_details"

    .line 132
    invoke-interface {v7, v8}, Lorg/w3c/dom/Element;->getElementsByTagName(Ljava/lang/String;)Lorg/w3c/dom/NodeList;

    move-result-object v2

    .line 134
    .local v2, list:Lorg/w3c/dom/NodeList;
    invoke-interface {v2}, Lorg/w3c/dom/NodeList;->getLength()I

    move-result v3

    .line 135
    .local v3, size:I
    new-instance v5, Ljava/util/ArrayList;

    invoke-direct {v5, v3}, Ljava/util/ArrayList;-><init>(I)V

    .line 136
    .local v5, statuses:Ljava/util/List;,"Ljava/util/List<Lweibo4android/RetweetDetails;>;"
    const/4 v1, 0x0

    .local v1, i:I
    :goto_1
    if-ge v1, v3, :cond_0

    .line 137
    invoke-interface {v2, v1}, Lorg/w3c/dom/NodeList;->item(I)Lorg/w3c/dom/Node;

    move-result-object v4

    check-cast v4, Lorg/w3c/dom/Element;

    .line 138
    .local v4, status:Lorg/w3c/dom/Element;
    new-instance v7, Lweibo4android/RetweetDetails;

    invoke-direct {v7, p0, v4, p1}, Lweibo4android/RetweetDetails;-><init>(Lweibo4android/http/Response;Lorg/w3c/dom/Element;Lweibo4android/Weibo;)V

    invoke-interface {v5, v7}, Ljava/util/List;->add(Ljava/lang/Object;)Z
    :try_end_0
    .catch Lweibo4android/WeiboException; {:try_start_0 .. :try_end_0} :catch_0

    .line 136
    add-int/lit8 v1, v1, 0x1

    goto :goto_1

    .line 141
    .end local v1           #i:I
    .end local v2           #list:Lorg/w3c/dom/NodeList;
    .end local v3           #size:I
    .end local v4           #status:Lorg/w3c/dom/Element;
    .end local v5           #statuses:Ljava/util/List;,"Ljava/util/List<Lweibo4android/RetweetDetails;>;"
    :catch_0
    move-exception v6

    .line 142
    .local v6, te:Lweibo4android/WeiboException;
    const-string v7, "nil-classes"

    invoke-static {v7, v0}, Lweibo4android/RetweetDetails;->ensureRootNodeNameIs(Ljava/lang/String;Lorg/w3c/dom/Document;)V

    .line 143
    new-instance v5, Ljava/util/ArrayList;

    invoke-direct {v5, v9}, Ljava/util/ArrayList;-><init>(I)V

    goto :goto_0
.end method

.method private init(Lweibo4android/http/Response;Lorg/w3c/dom/Element;Lweibo4android/Weibo;)V
    .locals 3
    .parameter "res"
    .parameter "elem"
    .parameter "weibo"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lweibo4android/WeiboException;
        }
    .end annotation

    .prologue
    .line 87
    const-string v0, "retweet_details"

    invoke-static {v0, p2}, Lweibo4android/RetweetDetails;->ensureRootNodeNameIs(Ljava/lang/String;Lorg/w3c/dom/Element;)V

    .line 88
    const-string v0, "retweet_id"

    invoke-static {v0, p2}, Lweibo4android/RetweetDetails;->getChildLong(Ljava/lang/String;Lorg/w3c/dom/Element;)J

    move-result-wide v0

    iput-wide v0, p0, Lweibo4android/RetweetDetails;->retweetId:J

    .line 89
    const-string v0, "retweeted_at"

    invoke-static {v0, p2}, Lweibo4android/RetweetDetails;->getChildDate(Ljava/lang/String;Lorg/w3c/dom/Element;)Ljava/util/Date;

    move-result-object v0

    iput-object v0, p0, Lweibo4android/RetweetDetails;->retweetedAt:Ljava/util/Date;

    .line 90
    new-instance v1, Lweibo4android/User;

    const-string v0, "retweeting_user"

    invoke-interface {p2, v0}, Lorg/w3c/dom/Element;->getElementsByTagName(Ljava/lang/String;)Lorg/w3c/dom/NodeList;

    move-result-object v0

    const/4 v2, 0x0

    invoke-interface {v0, v2}, Lorg/w3c/dom/NodeList;->item(I)Lorg/w3c/dom/Node;

    move-result-object v0

    check-cast v0, Lorg/w3c/dom/Element;

    .line 91
    invoke-direct {v1, p1, v0, p3}, Lweibo4android/User;-><init>(Lweibo4android/http/Response;Lorg/w3c/dom/Element;Lweibo4android/Weibo;)V

    .line 90
    iput-object v1, p0, Lweibo4android/RetweetDetails;->retweetingUser:Lweibo4android/User;

    .line 92
    return-void
.end method

.method private init(Lweibo4android/org/json/JSONObject;)V
    .locals 4
    .parameter "json"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lweibo4android/WeiboException;
        }
    .end annotation

    .prologue
    .line 70
    :try_start_0
    const-string v1, "retweetId"

    invoke-virtual {p1, v1}, Lweibo4android/org/json/JSONObject;->getInt(Ljava/lang/String;)I

    move-result v1

    int-to-long v1, v1

    iput-wide v1, p0, Lweibo4android/RetweetDetails;->retweetId:J

    .line 71
    const-string v1, "retweetedAt"

    invoke-virtual {p1, v1}, Lweibo4android/org/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    const-string v2, "EEE MMM dd HH:mm:ss z yyyy"

    invoke-static {v1, v2}, Lweibo4android/RetweetDetails;->parseDate(Ljava/lang/String;Ljava/lang/String;)Ljava/util/Date;

    move-result-object v1

    iput-object v1, p0, Lweibo4android/RetweetDetails;->retweetedAt:Ljava/util/Date;

    .line 72
    new-instance v1, Lweibo4android/User;

    const-string v2, "retweetingUser"

    invoke-virtual {p1, v2}, Lweibo4android/org/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lweibo4android/org/json/JSONObject;

    move-result-object v2

    invoke-direct {v1, v2}, Lweibo4android/User;-><init>(Lweibo4android/org/json/JSONObject;)V

    iput-object v1, p0, Lweibo4android/RetweetDetails;->retweetingUser:Lweibo4android/User;
    :try_end_0
    .catch Lweibo4android/org/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    .line 77
    return-void

    .line 74
    :catch_0
    move-exception v0

    .line 75
    .local v0, jsone:Lweibo4android/org/json/JSONException;
    new-instance v1, Lweibo4android/WeiboException;

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Lweibo4android/org/json/JSONException;->getMessage()Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v3, ":"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {p1}, Lweibo4android/org/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2, v0}, Lweibo4android/WeiboException;-><init>(Ljava/lang/String;Ljava/lang/Exception;)V

    throw v1
.end method


# virtual methods
.method public equals(Ljava/lang/Object;)Z
    .locals 7
    .parameter "o"

    .prologue
    const/4 v1, 0x1

    const/4 v2, 0x0

    .line 151
    if-ne p0, p1, :cond_1

    .line 156
    :cond_0
    :goto_0
    return v1

    .line 152
    :cond_1
    instance-of v3, p1, Lweibo4android/RetweetDetails;

    if-nez v3, :cond_2

    move v1, v2

    goto :goto_0

    :cond_2
    move-object v0, p1

    .line 154
    check-cast v0, Lweibo4android/RetweetDetails;

    .line 156
    .local v0, that:Lweibo4android/RetweetDetails;
    iget-wide v3, p0, Lweibo4android/RetweetDetails;->retweetId:J

    iget-wide v5, v0, Lweibo4android/RetweetDetails;->retweetId:J

    cmp-long v3, v3, v5

    if-eqz v3, :cond_0

    move v1, v2

    goto :goto_0
.end method

.method public getRetweetId()J
    .locals 2

    .prologue
    .line 95
    iget-wide v0, p0, Lweibo4android/RetweetDetails;->retweetId:J

    return-wide v0
.end method

.method public getRetweetedAt()Ljava/util/Date;
    .locals 1

    .prologue
    .line 99
    iget-object v0, p0, Lweibo4android/RetweetDetails;->retweetedAt:Ljava/util/Date;

    return-object v0
.end method

.method public getRetweetingUser()Lweibo4android/User;
    .locals 1

    .prologue
    .line 103
    iget-object v0, p0, Lweibo4android/RetweetDetails;->retweetingUser:Lweibo4android/User;

    return-object v0
.end method

.method public hashCode()I
    .locals 6

    .prologue
    .line 161
    iget-wide v1, p0, Lweibo4android/RetweetDetails;->retweetId:J

    iget-wide v3, p0, Lweibo4android/RetweetDetails;->retweetId:J

    const/16 v5, 0x20

    ushr-long/2addr v3, v5

    xor-long/2addr v1, v3

    long-to-int v0, v1

    .line 162
    .local v0, result:I
    mul-int/lit8 v1, v0, 0x1f

    iget-object v2, p0, Lweibo4android/RetweetDetails;->retweetedAt:Ljava/util/Date;

    invoke-virtual {v2}, Ljava/util/Date;->hashCode()I

    move-result v2

    add-int v0, v1, v2

    .line 163
    mul-int/lit8 v1, v0, 0x1f

    iget-object v2, p0, Lweibo4android/RetweetDetails;->retweetingUser:Lweibo4android/User;

    invoke-virtual {v2}, Lweibo4android/User;->hashCode()I

    move-result v2

    add-int v0, v1, v2

    .line 164
    return v0
.end method

.method public toString()Ljava/lang/String;
    .locals 3

    .prologue
    .line 169
    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "RetweetDetails{retweetId="

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    .line 170
    iget-wide v1, p0, Lweibo4android/RetweetDetails;->retweetId:J

    invoke-virtual {v0, v1, v2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 171
    const-string v1, ", retweetedAt="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, p0, Lweibo4android/RetweetDetails;->retweetedAt:Ljava/util/Date;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 172
    const-string v1, ", retweetingUser="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, p0, Lweibo4android/RetweetDetails;->retweetingUser:Lweibo4android/User;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 173
    const/16 v1, 0x7d

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 169
    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method
